<%@ page language="java" import="java.util.*" import="java.sql.*" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">



<html>
<head>
	<jsp:useBean id="sql" class="com.tzq.JAVABEAN.ConnectDB" scope="page" />
<%	
	String Sessionid=null;
	if(session.getAttribute( "pid" )!=null){
		Sessionid=session.getAttribute( "pid" ).toString();
	}%>
	<meta http-equiv="content-type" content="text/html" />
	<meta name="author" content="blog.anchen8.net" />
	<title>毕业生，你的选择</title>
    <link rel="stylesheet" type="text/css" href="../css/video.css" />
    <script type="text/javascript">
        function createMain(){
            var _scrollWidth=Math.max(document.body.scrollWidth,document.documentElement.scrollWidth);
            var _scrollHeight=Math.max(document.body.scrollHeight,document.documentElement.scrollHeight);
                document.getElementById("main").style.left=(_scrollWidth-950)/2+"px";
               // document.getElementById("m").style.height=_scrollHeight+"px";
        }
        function logohover(){
            document.getElementById("logovideo").style.opacity=0.6;
        }
        function logoout(){
            document.getElementById("logovideo").style.opacity=1.0;
        }
        function videoswitch(val){
            if(val=="total"){
                document.getElementById("totalvideo").style.display="block";
                document.getElementById("newvideo").style.display="none";
                document.getElementById("swclickli").style.fontWeight="bold";
                document.getElementById("swnewli").style.fontWeight="normal";
            }
            else{
                document.getElementById("totalvideo").style.display="none";
                document.getElementById("newvideo").style.display="block";
                document.getElementById("swclickli").style.fontWeight="normal";
                document.getElementById("swnewli").style.fontWeight="bold";
            }
        }
    </script>
</head>

<body class="body">
    <div class="main" id="main">
        <div class="search">
            <div class="logovideo" id="logovideo" onmouseover="logohover()" onmouseout="logoout()">
                <img src="/Bys-Website/SourceImageFile/videologo.jpg"/>
            </div>
            <div class="searchbar">
                <input class="searchtext" type="text" dir="微电影" value="微电影" style="color: #777;" onfocus="if(this.value==this.getAttribute('dir')){this.value=''} this.style.color='#000'" onblur="if(this.value==''){this.value=this.getAttribute('dir')}this.style.color='#777'"/>
                <input type="button" value="搜索" class="searchbtn"/>
            </div>
            <div class="videoswitch">
                <ul class="videoswul">
                    <li class="swclickli" id="swclickli"><a href="#" onclick="videoswitch('total')">点击榜</a></li>
                    <li class="swnewli" id="swnewli"><a href="#" onclick="videoswitch('new')">新视榜</a></li>
                </ul>
            </div>
        </div>
        <div class="totalvideo" id="totalvideo">
	        <div class="videotitle">
	            <span class="vtitlezi">点击榜</span><span class="vtitlefu">&gt;&gt;</span><span class="vtitlezi">电子科技大学</span><span class="vtitlefu">&gt;&gt;</span><span class="vtitlezi">许诺</span><span class="vtitlefu">&gt;&gt;</span><span class="vtitlezi">毕业视频</span>
	            <div class="titleclick">
	                <span>今日点击榜</span>
	            </div>
            <%
	            try {
					ResultSet rsVideos = sql.executeQuery("SELECT TOP 10 * FROM Videos ORDER BY ClickTimes DESC");
            		if( rsVideos.next()) {%>
	        </div>
	        <div class="videopos">
	            <img src="/Bys-Website/<%=rsVideos.getString("ThumbnailPath").substring(0, rsVideos.getString("ThumbnailPath").lastIndexOf('.'))+"big.png" %>" width="611px" height="500px"/>
	        </div>
	        <div class="rank">
	        		<%}
					int k=1;//表示视频排名
					do {
						ResultSet rsUser = sql.executeQuery("SELECT UserName,UserID FROM Userinfo WHERE UserID=?", new String[]{rsVideos.getString("UserID")}, new boolean[]{true});
						rsUser.next();
						ResultSet rsSchool = sql.executeQuery("SELECT SchoolName FROM Schools WHERE SchoolID=?", new String[]{rsVideos.getString("VideoSchoolID")}, new boolean[]{true});
						rsSchool.next();
						String rankPic="rank"+k;
						rankPic=rankPic+".jpg";
						%>				
							<div class="rankdetail">
				                <div class="whatrank">
				                    <img src="/Bys-Website/SourceImageFile/<%=rankPic %>" width="40px" height="40px"/>
				                </div>
				                <div class="videoinfo">
				                    <div class="vname">片名:<a href="/Bys-Website/PersonVideo/ShowVideo.jsp?vid=<%=rsVideos.getString("VideoID") %>"><%=rsVideos.getString("VideoTitle") %></a></div>
				                    <div class="vclick"><%=rsVideos.getString("ClickTimes") %>点击</div>
				                </div>
				                <div class="videoer">
				                    <div class="ername">作者：<a href="/Bys-Website/PersonMainPage.jsp?userID=<%=rsUser.getString("UserID")%>"><%=rsUser.getString("UserName") %></a></div>
				                    <div class="erschool"><%=rsSchool.getString("SchoolName") %></div>
				                </div>
	            			</div>
						<%
						rsUser.close();
						rsSchool.close();
						k++;
					} while(rsVideos.next());
					rsVideos.close();
				} catch(Exception e) {
					e.printStackTrace();
				}%>
        	</div>
        </div>
        <div class="ashr">
        </div>
        
        <div id="newvideo" class="newvideo">
            <div class="videotitle">
                <span class="vtitlezi">新视榜</span><span class="vtitlefu">&gt;&gt;</span><span class="vtitlezi">电子科技大学</span><span class="vtitlefu">&gt;&gt;</span><span class="vtitlezi">许诺</span><span class="vtitlefu">&gt;&gt;</span><span class="vtitlezi">毕业视频</span>
                <div class="titleclick">
                    <span>最新上传榜</span>
                </div>
            </div>
            <div class="videopos">
                <img src="image/tfz.jpg" width="611px" height="500px"/>
            </div>
            <div class="rank">
                <div class="rankdetail">
                    <div class="whatrank">
                        <img src="/Bys-Website/SourceImageFile/rank1.jpg" width="40px" height="40px"/>
                    </div>
                    <div class="videoinfo">
                        <div class="vname">片名:太极</div>
                        <div class="vclick">11111点击</div>
                    </div>
                    <div class="videoer">
                        <div class="ername">作者：<a href="personal.html" target="_blank">uestc_xunuo</a></div>
                        <div class="erschool">电子科技大学</div>
                    </div>
                </div>
            
                <div class="rankdetail">
                    <div class="whatrank">
                        <img src="image/rank2.jpg" width="40px" height="40px"/>
                    </div>
                    <div class="videoinfo">
                        <div class="vname">片名:铜雀台</div>
                        <div class="vclick">11111点击</div>
                    </div>
                    <div class="videoer">
                        <div class="ername">作者：<a href="personal.html" target="_blank">小弟娃儿</a></div>
                        <div class="erschool">四川大学</div>
                    </div>
                </div>
            
                <div class="rankdetail">
                    <div class="whatrank">
                        <img src="image/rank3.jpg" width="40px" height="40px"/>
                    </div>
                    <div class="videoinfo">
                        <div class="vname">片名:图形学</div>
                        <div class="vclick">11111点击</div>
                    </div>
                    <div class="videoer">
                        <div class="ername">作者：<a href="personal.html" target="_blank">fuck_fu</a></div>
                        <div class="erschool">深圳大学</div>
                    </div>
                </div>
                <div class="rankdetail">
                    <div class="whatrank">
                        <img src="image/rank4.jpg" width="40px" height="40px"/>
                    </div>
                    <div class="videoinfo">
                        <div class="vname">片名:太极</div>
                        <div class="vclick">11111点击</div>
                    </div>
                    <div class="videoer">
                        <div class="ername">作者：<a href="personal.html" target="_blank">uestc_xunuo</a></div>
                        <div class="erschool">电子科技大学</div>
                    </div>
                </div>
                <div class="rankdetail">
                    <div class="whatrank">
                        <img src="image/rank5.jpg" width="40px" height="40px"/>
                    </div>
                    <div class="videoinfo">
                        <div class="vname">片名:太极</div>
                        <div class="vclick">11111点击</div>
                    </div>
                    <div class="videoer">
                        <div class="ername">作者：<a href="personal.html" target="_blank">uestc_xunuo</a></div>
                        <div class="erschool">电子科技大学</div>
                    </div>
                </div>
                <div class="rankdetail">
                    <div class="whatrank">
                        <img src="image/rank6.jpg" width="40px" height="40px"/>
                    </div>
                    <div class="videoinfo">
                        <div class="vname">片名:太极</div>
                        <div class="vclick">11111点击</div>
                    </div>
                    <div class="videoer">
                        <div class="ername">作者：<a href="personal.html" target="_blank">uestc_xunuo</a></div>
                        <div class="erschool">电子科技大学</div>
                    </div>
                </div>
                <div class="rankdetail">
                    <div class="whatrank">
                        <img src="image/rank7.jpg" width="40px" height="40px"/>
                    </div>
                    <div class="videoinfo">
                        <div class="vname">片名:太极</div>
                        <div class="vclick">11111点击</div>
                    </div>
                    <div class="videoer">
                        <div class="ername">作者：<a href="personal.html" target="_blank">uestc_xunuo</a></div>
                        <div class="erschool">电子科技大学</div>
                    </div>
                </div>
                <div class="rankdetail">
                    <div class="whatrank">
                        <img src="image/rank8.jpg" width="40px" height="40px"/>
                    </div>
                    <div class="videoinfo">
                        <div class="vname">片名:太极</div>
                        <div class="vclick">11111点击</div>
                    </div>
                    <div class="videoer">
                        <div class="ername">作者：<a href="personal.html" target="_blank">uestc_xunuo</a></div>
                        <div class="erschool">电子科技大学</div>
                    </div>
                </div>
                <div class="rankdetail">
                    <div class="whatrank">
                        <img src="image/rank9.jpg" width="40px" height="40px"/>
                    </div>
                    <div class="videoinfo">
                        <div class="vname">片名:太极</div>
                        <div class="vclick">11111点击</div>
                    </div>
                    <div class="videoer">
                        <div class="ername">作者：<a href="personal.html" target="_blank">uestc_xunuo</a></div>
                        <div class="erschool">电子科技大学</div>
                    </div>
                </div>
                <div class="rankdetail">
                    <div class="whatrank">
                        <img src="image/rank10.jpg" width="40px" height="40px"/>
                    </div>
                    <div class="videoinfo">
                        <div class="vname">片名:太极</div>
                        <div class="vclick">11111点击</div>
                    </div>
                    <div class="videoer">
                        <div class="ername">作者：<a href="personal.html" target="_blank">uestc_xunuo</a></div>
                        <div class="erschool">电子科技大学</div>
                    </div>
                </div>
            </div>
        </div>
        <div class="comment">
            <textarea id="texta" rows="4" cols="100" dir="发表评论" style="color: #777;" onfocus="if(this.value==this.getAttribute('dir')){this.value=''} this.style.color='#000'" onblur="if(this.value==''){this.value=this.getAttribute('dir')}this.style.color='#777'">发表评论</textarea>
            <div class="commsub">
                <div class="commnum">
                    共300条
                </div>
                <div class="commbtn">
                <form>
                    <input type="button" value="发表评论"/>
                </form>
                </div>
            </div>
        </div> 
        <div class="commout">
            <div class="commshow">
                1楼：<a href="#">许诺</a>
                <p>接下来是对这则视频的评论接下来是对这则视频的评论接下来是对这则视频的评论接下来是对这则视频的评论
                接下来是对这则视频的评论接下来是对这则视频的评论接下来是对这则视频的评论接下来是对这则视频的评论
                </p>
            </div>
            <div class="commshow">
                2楼：<a href="#">唐志强</a>
                <p>接下来是对这则视频的评论接下来是对这则视频的评论接下来是对这则视频的评论接下来是对这则视频的评论
                接下来是对这则视频的评论接下来是对这则视频的评论接下来是对这则视频的评论接下来是对这则视频的评论
                </p>
            </div>
            <div class="commshow">
                3楼：<a href="#">陈又福</a>
                <p>接下来是对这则视频的评论接下来是对这则视频的评论接下来是对这则视频的评论接下来是对这则视频的评论
                接下来是对这则视频的评论接下来是对这则视频的评论接下来是对这则视频的评论接下来是对这则视频的评论
                </p>
            </div>
            <div class="commshow">
                4楼：<a href="#">小弟娃</a>
                <p>接下来是对这则视频的评论接下来是对这则视频的评论接下来是对这则视频的评论接下来是对这则视频的评论
                接下来是对这则视频的评论接下来是对这则视频的评论接下来是对这则视频的评论接下来是对这则视频的评论
                </p>
            </div>
            <div class="commshow">
                5楼：<a href="#">老孙</a>
                <p>接下来是对这则视频的评论接下来是对这则视频的评论接下来是对这则视频的评论接下来是对这则视频的评论
                接下来是对这则视频的评论接下来是对这则视频的评论接下来是对这则视频的评论接下来是对这则视频的评论论接下来是对这则视频的评论接下来是对论接下来是对这则视频的评论接下来是对论接下来是对这则视频的评论接下来是对论接下来是对这则视频的评论接下来是对
                </p>
            </div>
            <div class="commshow">
                6楼：<a href="#">小弟娃</a>
                <p>接下来是对这则视频的评论接下来是对这则视频的评论接下来是对这则视频的评论接下来是对这则视频的评论
                接下来是对这则视频的评论接下来是对这则视频的评论接下来是对这则视频的评论接下来是对这则视频的评论
                </p>
            </div>
        </div>
    </div>
    <script>    
        createMain();
    </script>
    <div class="topbar">
        <div class="logo">
        	<a href="/Bys-Website/Public/home.jsp">
            	<img src="/Bys-Website/SourceImageFile/toplogo.jpg"/>
            </a>
        </div>
        <div class="navi">
            <ul class="naviul">
                <li><a href="/Bys-Website/Public/Video.jsp" class="inli">视频</a></li>
				<li><a href="/Bys-Website/Public/Photo.jsp" class="outli">相册</a></li>
				<li><a href="/Bys-Website/Public/Blog.jsp" class="outli">博客</a></li>
            </ul>
        </div>
        <div class="loginfo">
            <ul class="loginfoul">
           	 <% if(session.getAttribute("pid")==null){%>
                <li><a href="/Bys-Website/Log_in.jsp">登录</a></li>
                <li><a href="/Bys-Website/Regist.jsp">注册</a></li>
                <%}else{
					String userID = session.getAttribute("pid").toString();%>
					<li><a href="/Bys-Website/PersonMainPage.jsp?userID=<%=session.getAttribute("pid").toString() %>"><%=session.getAttribute("username") %></a></li>     
					<li><a href="../LoginServlet?method=1">退出</a></li>
				<%}%> 
            </ul>
        </div>
    </div>
</body>
</html>